import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import  './assets/global.css'
import axios from 'axios'
import  '../src/assets/fonts/iconfont.css'
import '../src/plugins/element-drog.js';
import tabletree from 'vue-table-with-tree-grid'

Vue.component('table-tree', tabletree)
Vue.config.productionTip = false

axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
Vue.prototype.$http = axios

//axios 请求拦截器 为每次请求在请求报文加上 authorization 字段
//保证拥有获取数据的权限
axios.interceptors.request.use(config => {
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
